package com.news.dto;

import java.util.List;

/**
 * @Author: Clb
 * @Date: 2019/1/10 13:56
 * @Description:
 */
public class Page {
    /**
     * 起始数据索引
     */
    private Long beginPos;
    /**
     * 当前页索引
     */
    private Long curPage;
    /**
     * 总页数
     */
    private Long pageCount;
    /**
     * 每页显示数
     */
    private Long pageSize;
    /**
     * 数据
     */
    private List<Object> rows;
//    private Long total;  //数据数

    public Long getBeginPos() {
        return beginPos;
    }

    public Page setBeginPos(Long beginPos) {
        this.beginPos = beginPos;
        return this;
    }

    public Long getCurPage() {
        return curPage;
    }

    public Page setCurPage(Long curPage) {
        this.curPage = curPage;
        return this;
    }

    public Long getPageCount() {
        return pageCount;
    }

    public Page setPageCount(Long pageCount) {
        this.pageCount = pageCount;
        return this;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public Page setPageSize(Long pageSize) {
        this.pageSize = pageSize;
        return this;
    }

    public List<Object> getRows() {
        return rows;
    }

    public Page setRows(List<Object> rows) {
        this.rows = rows;
        return this;
    }

    public int getTotal() {
        if (rows==null){
            return 0;
        }
        return rows.size();
    }
}
